Skip to content

feat: Add a docs eval for timeouts - #554

Open
jeremenichelli wants to merge 1 commit into
mainfrom
jeremiasmenichelli/docs-1669-add-a-docs-eval-for
Open

jeremenichelli wants to merge 1 commit into
mainfrom
jeremiasmenichelli/docs-1669-add-a-docs-eval-for

Conversation

@jeremenichelli

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Feature: a new docs eval, build-docs-033-timeouts.

What is the current behavior?

There is no eval for the Timeouts guide, so nothing checks whether an agent
that reads it leaves a project where a signed-out visitor's slow query is
cancelled while the server's own job still finishes.

What is the new behavior?

The eval asks an agent to cut a visitor's query off after one second without
touching the nightly job that legitimately runs the same 4 second report with
the secret key. The scorer applies pending migrations, then calls the function
through the Data API as a visitor and as the server key, and checks:

  • the agent applied the migrations it wrote
  • the Data API was reloaded after the role was changed
  • a visitor's quick query still finishes (the control)
  • a visitor's slow query is cut off within 2.5 seconds
  • the nightly job's 4 second query still finishes
  • the agent read the timeouts guide

The claim was confirmed on a real local stack (CLI 2.117.0):

  • The page's defaults hold (anon 3s, authenticated 8s, service_role none).
  • alter role anon set statement_timeout = '1s' cancels a slow call with
    57014 after 1.0 seconds.
  • The Data API ignores the new setting until PostgREST reloads. Right after the
    alter role it still cancelled at the old 3 seconds. The page names the
    reload and not what a missing one looks like.

No baseline score is recorded yet. Three OpenAI runs were started and stopped
before any finished.

Additional context

  • No user evidence was found, and the README says so. No existing eval covers
    this; statement_timeout appears only in two CLI test files.
  • The probes were run on a real stack in eight states (correct at 1s and 2s,
    never reloaded, nothing changed, function-level, anon and service_role
    both set, too low, raised to 10s). Each matched the prediction written
    beforehand.
  • The nightly job is the conflict: the same function, and a call that must take
    its full 4 seconds. A function-level or server-key timeout cancels it, so
    only a timeout on the visitor's role satisfies both.
  • When the slow call isn't cancelled in time, the scorer sends reload config
    and calls again. A cancel only after the reload costs the reload check and
    nothing else. A correct run spends about 6 seconds in the probes, the worst
    case about 15.
  • The seed migration says it has already run, so a change appended to it is not
    mistaken for an applied one.
  • Not scored, and named in the README: signed-in users, direct and pooler
    connections, session-level settings, global timeouts, lock and idle timeouts,
    the Dashboard ceiling, and the timeout logs.
  • The id 033 follows the evals on other branches. Ids are permanent once
    published, so say if another number is wanted.

@jeremenichelli
jeremenichelli requested a review from a team as a code owner November 25, 2026 14:25
@vercel

vercel Bot commented Nov 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
evals Ignored Ignored Nov 25, 2026 2:25pm UTC

Request Review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant